package com.infore.dataAudit.enums;

/**
 * 系统数据标识
 * @author cys
 *
 */
public enum SystemDataStatus {
    N("N", "正常"),                  //有效
    T("T", "超上限"),          //
    L("L", "超下限"),    
    P("P", "电源故障"),
    D("D", "仪器故障"),
    F("F", "仪器通信故障"),
    B("B", "仪器离线"),
    Z("Z", "取水点无水样"),
    S("S", "手工输入数据"),
    M("M", "维护调试数据"),
    Hd("Hd", "现场启动数据");
    
  //防止字段值被修改，增加的字段也统一final表示常量
    private final String key;
    private final String value;
    
    private SystemDataStatus(String key,String value){
        this.key = key;
        this.value = value;
    }
    //根据key获取枚举
    public static SystemDataStatus getEnumByKey(String key){
        if(null == key){
            return null;
        }
        for(SystemDataStatus temp:SystemDataStatus.values()){
            if(temp.getKey().equals(key)){
                return temp;
            }
        }
        return null;
    }
    public String getKey() {
        return key;
    }
    public String getValue() {
        return value;
    }
}
